import Vue from 'vue'
import VueRouter, { RouteConfig } from 'vue-router'

Vue.use(VueRouter)

const routes: Array<RouteConfig> = [
  // 主页（温伟杰）
    {
        path: '/',
        component: () => import('@/views/Main.vue'),
        redirect: '/home',
        children: [
            // 商品页面
            {
                path: '/home',
                component: () => import('@/views/Goods/Home.vue'),
                redirect:'/som',
                children:[
                {
                    path:'/som',
                    component:()=>import('@/views/Goods/Som.vue'),
                }
                ]
            },
            // 评论页面
            {
                path: '/evaluation',
                component: () => import('@/views/Evaluation/Evaluation.vue'),
                redirect:'/evaluation/all',
                children:[
                    {
                        path:'/evaluation/all',
                        component:()=>import('@/views/Evaluation/AllPage.vue'),
                    },
                    {
                        path:'/evaluation/Satisfied',
                        component:()=>import('@/views/Evaluation/Satisfied.vue'),
                    },
                    {
                        path:'/evaluation/Unsatisfied',
                        component:()=>import('@/views/Evaluation/Unsatisfied.vue'),
                    },
                ]
            },
            // 商家页面
            {
                path: '/merchants',
                component: () => import('@/views/Merchants/Merchants.vue')
            }
        ]
    },
    {
        path: '/detail',
        name:"Detail",
        component:() => import('@/views/Detail.vue')
    }
    
]

const router = new VueRouter({
  routes
})

export default router

